﻿from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'www.views.home', name='home'),
    # url(r'^www/', include('www.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),

    (r'^(?i)(?P<path>.*)', 'django.views.static.serve', {'document_root':'media'}),
    #静态文件这里搞了半宿，总是提示编码错误；最后查了mimetypes.py的源代码249行，发现是在获取系统默认编码时，Windows的注册表里有MIME的Content Type里有中文。不知道是不是Python的BUG
    #对应的注册表路径\HKEY_CLASSES_ROOT\MIME\Database\Content Type
    #修改<Python>\Lib\mimetypes.py，行249，增加try即可
)
